package com.ty.controller;

import com.ty.pojo.FettersAndPaertner;
import com.ty.pojo.FettersPartner;
import com.ty.pojo.Partner;
import com.ty.service.FettersPartnerService;
import com.ty.vo.SysResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import springfox.documentation.swagger2.annotations.EnableSwagger2;

import java.util.List;

@RestController
@RequestMapping("/FettersPartner")
@CrossOrigin
@EnableSwagger2
public class FettersPartnerController {
    @Autowired
    private FettersPartnerService fettersPartnerService;
    //查询羁绊表中的伙伴
    @GetMapping("/getFettersPartnerlist/{id}")
    public SysResult getFettersPartnerlist(@PathVariable Integer id){
        List<FettersPartner> fettersPartnerList = fettersPartnerService.getFettersPartnerlist(id);
        return SysResult.success(fettersPartnerList);
    }
    //查询羁绊表中需要新增的伙伴
    @GetMapping("/getAddPartner")
    public SysResult getAddPartner(){
        List<Partner> partnerList = fettersPartnerService.getAddPartner();
        return SysResult.success(partnerList);
    }

}
